const express = require("express");

const registerLogin = require("./router/registerLogin");
const home = require("./router/home");
const cors = require("cors");

const bodyParser = require("body-parser");
const app = express();
app.use(express.static("public"));
app.use(bodyParser.urlencoded({extended:true}));

app.use(registerLogin);
app.use(home);
//解决跨域  要加（）调用一下
app.use(cors());

app.listen(3000,err=>{
    if(!err) console.log("服务器启动成功！");
    else console.log(err);
})